package com.slz3.business.module.configManagement.conZone.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conZone.domain.ConZone;
import com.slz3.business.module.configManagement.conZone.domain.ConZoneCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConZoneResController {

    static Mono<ServerResponse> add(ServerRequest req, ConZone conZone) {
        if (ConZoneResUnsafeValid.add(req, conZone)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.add_$ConZoneUpdateLock(req, conZone);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, ConZoneCondition conZoneCondition) {
        if (ConZoneResUnsafeValid.delete(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.delete_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, ConZone conZone) {
        if (ConZoneResUnsafeValid.modify(req, conZone)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.modify_$ConZoneUpdateLock(req, conZone);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (ConZoneResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (ConZoneResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.info_$ConZoneUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (ConZoneResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, ConZoneCondition conZoneCondition) {
        //
        if (ConZoneResUnsafeValid.auditSubmit(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.auditSubmit_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, ConZoneCondition conZoneCondition) {
        if (ConZoneResUnsafeValid.audit(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.audit_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, ConZoneCondition conZoneCondition) {
        if (ConZoneResUnsafeValid.auditReject(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.auditReject_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, ConZoneCondition conZoneCondition) {
        if (ConZoneResUnsafeValid.usingEnable(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.usingEnable_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, ConZoneCondition conZoneCondition) {
        if (ConZoneResUnsafeValid.usingDisable(req, conZoneCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConZoneResAtomic.usingDisable_$ConZoneUpdateLock(req, conZoneCondition);
        }
    }

}
